﻿{include file="public/header"}
<title>问题修改</title>
</head>
<body>

<style>
    .form-label{
        width: 25% !important;
    }
    .row{
        margin-bottom: 3% !important;
    }

</style>
<article class="page-container">
<form>
    {if condition="$data== 0"}
    <div class="ch-row ch-info-form">
        <div class="flex1">节点名称：</div>
        <div class="flex2">
            <input type="text" class="form-control"  name="node_name"  placeholder="请输入主菜单名称">
            <input type="hidden"  name="pId" value="0">
        </div>
    </div>
    {else}
    <div class="ch-row ch-info-form">
        <div class="flex1">节点名称：</div>
        <div class="flex2">
            <input type="text"  name="node_name" class="title form-control" placeholder="请输入主菜单" >
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">控制器名：</div>
        <div class="flex2">
            <input type="text"  name="control_name" class="title form-control" placeholder="请输入控制器名" >
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">方法名：</div>
        <div class="flex2">
            <input type="text"  name="action_name" class="title form-control" placeholder="方法名" >

        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">传递参数：</div>
        <div class="flex2">
            <input type="text"  name="type_id" class="title form-control" placeholder="请输入参数" >

        </div>
    </div>
    <input type="hidden"  name="pId" value="{$data}">
    {/if}
    <div class="ch-row ch-info-form">
        <div class="flex1">
            <button class="btn btn-primary radius" style="width: 100%" type="button" ><i class="Hui-iconfont">&#xe632;</i> 提交</button>
        </div>
    </div>

</form>
</article>

{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var src="{:Url('index/Role/remote_ad')}?id=0";
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data:$('form').serializeArray(),
                success: function (data) {
                    var res=JSON.parse(data);
                    if(res.code==200){
                        parent.location.reload()
                    }else{
                        layer.msg(res.msg,{icon: 5,time:1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });



    });
</script>
</body>
</html>